import { CITY, COUNTY, SCHOOL, NONE } from '../../../constants/area';
export const INITIALIZE_STATE = {
	// 默认三级视图(城市,区县,学校)
	subView: NONE,
};
import { SWITCH_SUB_VIEW } from '../actions/level3Navigator';
/**
 * 处理基础
 * @param  {[type]} state  [description]
 * @param  {Object} action [description]
 * @return {[type]}        [description]
 */
export default function level3Navigator(state = INITIALIZE_STATE, action = {}) {
	let { type,...others } = action;
	switch(type) {
		case SWITCH_SUB_VIEW:
			// TODO: 默认三级视图(城市,区县,学校)
			{
				let { subView } = others.payload;
				let newState = Object.assign({},state,{
					subView
				})
				return newState;
			};
		default: 
			return state;
	}
};